package ui20131001.helper
{
	import net.NetLoader;

	/**
	 * 个人用户的接口集合, 定义接口
	 * @author limin
	 * 
	 */
	public class IndividualUsersService
	{
		/** 获得个人用户设备列表 */
		public static function getMemberDevice(callback:Function):void
		{
			var loader:NetLoader = new NetLoader();
			
			var url:String = Global.getServerPathByAction(ActionConst.GET_MEMBER_DEVICES);
			url += "&type=" + Global.deviceType;
			url += "&node=" + 0;//节点:个人用户为0
			url += "&page=" + 1;
			url += "&perpage=100";
			
			loader.load(url,callback);
		}
		
		/**
		 * 取得设备定位记录
		 * @param callback
		 * @param bDate(2013-12-31)
		 * @param bHour(0-23)
		 * @param bMin(0-59)
		 * @param eDate
		 * @param eHour
		 * @param eMin
		 * 
		 */
		public static function getPositionData(callback:Function, device_id:String, 
											   bDate:String, bHour:String, bMin:String, 
											   eDate:String, eHour:String, eMin:String):void
		{
			var loader:NetLoader = new NetLoader();
			
			var url:String = Global.getServerPathByAction(ActionConst.GET_POSITION_DATA);
			url += "&id=" + device_id;
			url += "&begin_date=" + bDate;
			url += "&end_date=" + eDate;
			url += "&hour_begin=" + bHour;
			url += "&minute_begin=" + bMin;
			url += "&hour_end=" + eHour;
			url += "&minute_end=" + eMin;
			
			loader.load(url,callback);
		}
		
	}
}